import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SystemDataVO, SystemDataForm, SystemDataQuery } from '@/api/assess/system/systemData/types';

/**
 * 查询指标体系数据列表
 * @param query
 * @returns {*}
 */

export const listSystemData = (query?: SystemDataQuery): AxiosPromise<SystemDataVO[]> => {
  return request({
    url: '/assess/system/systemData/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询指标体系数据详细
 * @param id
 */
export const getSystemData = (id: string | number): AxiosPromise<SystemDataVO> => {
  return request({
    url: '/assess/system/systemData/' + id,
    method: 'get'
  });
};

/**
 * 新增指标体系数据
 * @param data
 */
export const addSystemData = (data: SystemDataForm) => {
  return request({
    url: '/assess/system/systemData',
    method: 'post',
    data: data
  });
};

/**
 * 修改指标体系数据
 * @param data
 */
export const updateSystemData = (data: SystemDataForm) => {
  return request({
    url: '/assess/system/systemData',
    method: 'put',
    data: data
  });
};

/**
 * 删除指标体系数据
 * @param id
 */
export const delSystemData = (id: string | number | Array<string | number>) => {
  return request({
    url: '/assess/system/systemData/' + id,
    method: 'delete'
  });
};
